from location import gpsdecoder
from utils import resulthandle
from intellgencespary import sparypumpserial

if __name__ == '__main__':
    pump_driver = sparypumpserial.DiaphragmPumpDriver('COM6', 115200)
    gps_decoder = gpsdecoder.GPSSerialListener("COM10", 115200)

    callback = resulthandle.ResultHandler(target=pump_driver.setflow_by_velocity)
    gps_decoder.addcallbackobj(callback)

    pump_driver.start()
    gps_decoder.start()
